package cn.kgc.junketing.provider.controller;

import cn.kgc.junketing.provider.entity.User;
import cn.kgc.junketing.provider.service.UserService;
import cn.kgc.junketing.provider.vo.ResponseBean;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Resource
    private UserService userService;

    @PostMapping("/doFindLoginUser")
    public ResponseBean findLoginUser(@RequestBody User user) {
        return this.userService.findLoginUser(user);
    }

    @PostMapping("/doFindUserByTicket")
    public User doFindUserByTicket(String ticket) {
        return this.userService.findUserByTicket(ticket);
    }
}
